/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package newkfp;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author $alama
 */
@Entity
@Table(name = "exporter_country")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ExporterCountry.findAll", query = "SELECT e FROM ExporterCountry e"),
    @NamedQuery(name = "ExporterCountry.findByExporterId", query = "SELECT e FROM ExporterCountry e where e.idExporter = :idExporter"),
    @NamedQuery(name = "ExporterCountry.findByIdExporterCountry", query = "SELECT e FROM ExporterCountry e WHERE e.idExporterCountry = :idExporterCountry")})
public class ExporterCountry implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
   @Basic(optional = false)
   @Column(name = "idExporter_Country")
   private Integer idExporterCountry;
    @JoinColumn(name = "idExporter", referencedColumnName = "idExporter")
    @ManyToOne(optional = false)
    private Exporter idExporter;
    @JoinColumn(name = "idcountry", referencedColumnName = "idcountry")
    @ManyToOne(optional = false)
    private Country idcountry;

    public ExporterCountry() {
    }

    public ExporterCountry(Integer idExporterCountry) {
        this.idExporterCountry = idExporterCountry;
    }

    public Integer getIdExporterCountry() {
        return idExporterCountry;
    }

    public void setIdExporterCountry(Integer idExporterCountry) {
        this.idExporterCountry = idExporterCountry;
    }

    public Exporter getIdExporter() {
        return idExporter;
    }

    public void setIdExporter(Exporter idExporter) {
        this.idExporter = idExporter;
    }

    public Country getIdcountry() {
        return idcountry;
    }

    public void setIdcountry(Country idcountry) {
        this.idcountry = idcountry;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idExporterCountry != null ? idExporterCountry.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ExporterCountry)) {
            return false;
        }
        ExporterCountry other = (ExporterCountry) object;
        if ((this.idExporterCountry == null && other.idExporterCountry != null) || (this.idExporterCountry != null && !this.idExporterCountry.equals(other.idExporterCountry))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "newkfp.ExporterCountry[ idExporterCountry=" + idExporterCountry + " ]";
    }
    
}
